The EditField is a self-validating control that can be used within an EditSheet or alone on a page. It supports a wide number of data types:
| (true|false) d = dirty r = required v = valid | ||||
| Boolean |
loading property...
|
d | ||
| Text: Short/Long/ |
loading property...
|
d r v |
loading property...
|
d r v |
| Text: Password |
loading property...
|
d r v |
||
| Numeric: Integer/Float/ |
loading property...
|
d r v |
loading property...
|
d r v |
| Currency |
loading property...
|
d r v |
||
| Date/Time |
loading property...
|
d r v |
loading property...
|
d r v |
| Select/browse (text) |
loading property...
|
d v |
loading property...
|
d r v |
| Linked select |
loading property...
|
d v |
loading property...
|
d v |
|
Test:
|
|
Site Term Value Picker dialog (from browse control) returns:
| type | subtype | description |
|---|---|---|
| Boolean | none | This is a checkbox field that will always return either 1 (checked) or 0 for it's value. |
| date | none |
This is a short text field with
"6" button to
the right. This button opens the calendar control in a drop-down picker.
It displays the short form of the date (mm/dd/yyyy).
A default format is used to enforce this format if the meta-xml does not
contain a value for <format>.
The default format for date is mm/dd/yyyy
|
| time | none | This displays the time in a short 24 hour format of "hh:mm". |
| text | short |
displays a single line (does not allow carriage returns). A default
charmask is used to enforce this format if the meta-xml does not
contain a value for <charmask>.
The default regular expression representing short text is ^[^<>&]*$
|
| text | long |
displays four lines (scrollable) in a control that allows carriage
returns. A default charmask is used to enforce this format if the meta-xml does not
contain a value for <charmask>. The default regular expression
representing long text is ^[^<>&]*$
|
| text | password |
displays same as text/short but uses a password INPUT type: a single line
(does not allow carriage returns). A default charmask is used to enforce this
format if the meta-xml does not contain a value for <charmask>.
The default regular expression representing short text is ^[^<>&]*$
|
| numeric | currency |
This displays the number passed into the control as a
currency value. A default format is used to enforce this format if the meta-xml does not
contain a value for <format>. The default format representing currency is
-1.1
|
| numeric | float |
Displays only numbers and a decimal point. A default format is used to enforce this format if the meta-xml does not
contain a value for <format>. The default format representing
floats is -1.1
|
| numeric | integer |
Displays only integers. A default charmask is used to enforce this format if the meta-xml does not
contain a value for <format>. The default format representing
integers is -1.1
|
| select | none | This is a list picker like the HTML SELECT. You can only pick from this list. |
| onError |
fires on error (when m_bDebug = true in HTC, shows alert as well)
event object propertieswindow.event.error String. Returns error detail. |
| onChange |
| fires when control value is changed. |
| onRequire |
fires when required status changes
event object propertieswindow.event.required Boolean. Returns true if field is marked as required and is currently empty, false otherwise |
| onValid |
fires when valid status changes
event object propertieswindow.event.valid Boolean. Returns true if field is is currently valid, false otherwise |
| onBrowse |
Only fired for fields where @onbrowse or @browse is set: fired when browse ellipsis (...) button clicked.
event object propertieswindow.event.value Boolean. Returns field value. |
| elEditField.focus() |
sets focus to the control (if control not disabled) and selects contents
(exceptions: Select control sets focus on button and does not select contents.
Any control that has a read-only browse button works similarly)
parametersnone return valuenone |
| elEditField.resetDefault() |
resets subcontrol value to the default set for the control, or an empty string
if no default set
parametersnone return valuenone |
| efSelect.reload(sID) |
Select control only: reloads control menu items using the original
MetaXML data island and the new sID provided
parameterssID Required. ID of field in meta-xml. return valuenone remarksUsed to reload a different list in a select list picker. |
| efSelect.addItem(sValue, sDIsplayValue) |
Select control only: adds a new menu item to picker
parameterssValue Required. underlying value for new item. sDIsplayValue Required. display value for new item. return valuenone |
| efSelect.removeItem(sValue) |
Select control only: removes a menu item from picker
parameterssValue Required. underlying value for item to be removed. return valuenone |
| DataXML |
xml data (from a recordset) data-island id. Usually in the format:
<document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> ... </document> |
| MetaXML | xml meta-data data-island id |
| ID | id matching the field id in the meta-xml for this field |
| bValue = elEditField.dirty |
| Read-only. Returns true if the control's value has been changed, false otherwise. |
|
bValue = elEditField.disabled
elEditField.disabled = bValue |
| Read-write. Returns true if the field is disabled (grayed-out, button and text input disabled), false otherwise. |
|
bValue = elEditField.readonly
elEditField.readonly = bValue |
| Read-write. Returns true if the field is readonly (not 3D, button removed), false otherwise. |
| bValue = elEditField.required |
| Read-only. Returns true if the field is required and currently has no value, false otherwise. OnRequire event fires when this value changes. |
| bValue = elEditField.valid |
| Read-only. Returns true if the field is currently valid, false otherwise. OnValid event fires when this value changes. |
|
bValue = elEditField.prompt
elEditField.prompt = bValue |
| Read-write. Sets or returns the prompt that will display when the control is empty. Select control only shows prompt if value is not equal to any of the options. |
|
sValue = elEditField.value
elEditField.value = sValue |
| Read-write. Returns the value contained in the field. OnChange event fires when this value changes. Cannot be set when contol is disabled. (Exception: Browse control value can be set if ellipsis (...) button has been enabled using @browsereadonly) |
| sValue = elSelect.displayvalue |
| Select control only: Read-only. Returns the display value for current value. |
| set elOptions = elSelect.options |
| Select control only: Read-only. Returns a collection of the option elements (DIVs) for the select's list of options. |
| set elOption = elSelect.selected |
| Select control only: Read-only. Returns the option element (DIV) currently selected from the select's list of options. |
<xml id='esMeta'>
<editfield>
<text id='dept_name' required='yes' maxlen='50' default='1' onchange='doOnChange()'>
<prompt><enter name></prompt>
</text>
<select id='dept_id'>
<select id='dept_id'>
<option value='1'>department 1</option>
<option value='2'>department 2</option>
<option value='3'>department 3</option>
<option value='4'>department 4</option>
<option value='5'>department 5</option>
<option value='6'>department 6</option>
<option value='7'>department 7</option>
<option value='8'>department 8</option>
<option value='9'>department 9</option>
</select>
</select>
</editfield>
</xml>